package com.agritech.decorator;

import com.agritech.proxy.MachineProxy; // 假设装饰器装饰代理对象

// 或者装饰 com.agritech.factory.AgriculturalMachine，或 com.agritech.machine.AgriculturalMachineContext
// 这里选择装饰 MachineProxy 来演示多层包装

public abstract class MachineDecorator implements MachineProxy {
    protected MachineProxy decoratedMachineProxy;

    public MachineDecorator(MachineProxy decoratedMachineProxy) {
        this.decoratedMachineProxy = decoratedMachineProxy;
    }

    // 通常装饰器会调用被装饰对象的方法
    @Override
    public void startOperation(String userId) {
        decoratedMachineProxy.startOperation(userId);
    }

    @Override
    public void stopOperation(String userId) {
        decoratedMachineProxy.stopOperation(userId);
    }

    @Override
    public void workOperation(String userId) {
        decoratedMachineProxy.workOperation(userId);
    }

    @Override
    public void displayStatus(String userId) {
        decoratedMachineProxy.displayStatus(userId);
    }

    @Override
    public String getMachineId() {
        return decoratedMachineProxy.getMachineId();
    }
}